<template>
	<uni-forms-item name="mode" label="时间格式">
		<cl-select-picker :options="dateModeList" v-model="formData.mode" @submit="formData.defaultVal = ''"
			:clearable="false" :disabled="disabled"></cl-select-picker>
	</uni-forms-item>
	<uni-forms-item label="默认值" name="defaultVal">
		<cl-date-picker v-model="formData.defaultVal" :dateType="formData.mode" placeholder="请选择" :disabled="disabled">
		</cl-date-picker>
	</uni-forms-item>
</template>

<script setup>
	import {
		ref
	} from 'vue'
	const props = defineProps({
		disabled: Boolean
	})
	const formData = defineModel()

	// 时间模式
	const dateModeList = [
		'YYYY',
		'YYYY-MM',
		'YYYY-MM-DD',
		'YYYY-MM-DD hh',
		'YYYY-MM-DD hh:mm',
		'YYYY-MM-DD hh:mm:ss',
		'hh',
		'hh:mm',
		'hh:mm:ss',
	]
</script>